﻿using Liang.DataBase.Model.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;

namespace Liang.DataBase.Mapping.MySql
{
   public class ConfigMap : EntityTypeConfiguration<sys_config>  
    {
       public ConfigMap()
        {
            // 表名
            this.ToTable("sys_config");

            // 主键
            this.HasKey(t => t.configId);

            // 属性设置
            this.Property(t => t.configId)
                .HasColumnName("configId")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.name)
                .HasColumnName("name")
                .HasMaxLength(120)
                .IsRequired();

            this.Property(t => t.copyright)
                .HasColumnName("copyright")
                .HasMaxLength(20);

            this.Property(t => t.init)
                .HasColumnName("init");

            this.Property(t => t.verifcode)
                .HasColumnName("verifcode")
                .HasMaxLength(10);

            this.Property(t => t.register)
                .HasColumnName("register");

            this.Property(t => t.phone)
                .HasColumnName("phone")
                .HasMaxLength(20);

            this.Property(t => t.organId)
                .HasColumnName("organId")
                .HasMaxLength(40);

            this.Property(t => t.organName)
                .HasColumnName("organName")
                .HasMaxLength(200);

            this.Property(t => t.user)
                .HasColumnName("user")
                .HasMaxLength(10);

            this.Property(t => t.regTime)
                .HasColumnName("regTime");
        }
    }
}
